/*
 * @Author: chenhuanhuan 2925102113@qq.com
 * @Date: 2024-12-16 08:59:19
 * @LastEditors: chenhuanhuan 2925102113@qq.com
 * @LastEditTime: 2025-02-20 10:19:20
 * @FilePath: \hbzc-groupmeal-center-web\src\api\Sku.ts
 */

import request from "@/utils/newrequst";

// SkU类别树结构
export const getSkuClassTree = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku-class/tree`, method: "post", data: data,
  });
};
// 分页查询SkU类别
export const getSkuClassList = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku-class/page`, method: "post", data: data,
  });
};

// 分页查询Sku信息 
export const getSkuInfoList = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku/page`, method: "post", data: data,
  });
};


// 生成SKU编码
export const getSkuCode = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku/generate-sku-code`, method: "post", data: data,
  });
};

// 设定匹配SPU优先采购
export const getSpuPurchasing = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku/setting-spu-priority-purchasing`, method: "post", data: data,
  });
};

// 添加SKU类别
export const addSkuClass = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku-class/add`, method: "post", data: data,
  });
};
// 编辑SKU类别
export const setSkuClass = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku-class/edit`, method: "post", data: data,
  });
};

// 删除SKU类别
export const delSkuClass = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku-class/delete`, method: "post", data: data,
  });
};

// 检查SKU类别名称是否存在
export const getCheckSkukClass = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku-class/check-name-exist`, method: "post", data: data,
  });
};

// SKU采购周期
export const getPurchasingCycle = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku-purchasing-cycle/list`, method: "post", data: data,
  });
};

// 校验SKU名称是否存在
export const getCheckSkukName = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku/check-name-exist`, method: "post", data: data,
  });
};


// 添加SKU
export const addSkuInfo = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku/add`, method: "post", data: data,
  });
};

// 修改SKU
export const setSkuInfo = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku/edit`, method: "post", data: data,
  });
};


// 设定上下架状态（启用-停用状态）
export const getSkuStatue = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku/settings-enable-state`, method: "post", data: data,
  });
};


// 删除sku
export const deleteSku = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku/delete`, method: "post", data: data,
  });
};

// SKU匹配SPU
export const skuMatchSpu = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku/match-spu`, method: "post", data: data,
  });
};
//设定匹配SPU优先采购
export const getPurchasingSpu = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku/setting-spu-priority-purchasing`, method: "post", data: data,
  });
};



